package com.business.user.controller;


import com.business.user.service.MembershipPackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.business.common.dto.R;

/**
 * 会员套餐表: 后端controller类
 * @author chenjiehong
 * @date 2019-12-01 22:14:07
 * @since 1.0
 */
@RestController
@RequestMapping(value = "/membershipPackage")
public class MembershipPackageController {

    @Autowired
    private MembershipPackageService membershipPackageServiceImpl;

    /**
     * 查询会员套餐表
     * 
     * 
     * @param params
     * @date 2019-12-01 22:14:08
     */
    @PostMapping("/query")
    @ResponseBody
    public R query(@RequestBody JSONObject params){
        Integer id = params.getInteger("id");
        return R.success(membershipPackageServiceImpl.query(id));
    }
    
    
    /**
     * 分页查询会员套餐表
     * 
     *
     * @date 2019-12-01 22:14:08
     */
    @PostMapping("/queryList")
    @ResponseBody
    public R queryPage(){
        return  R.success(membershipPackageServiceImpl.queryList());
    }


}